greedy regexp

Given the string "mississippi", if you run the regexp "(i.*s)" you should get "ississ", because regexp assumes greedy.

As I understand it, from use of other languages like Perl, you can cause regexp to be not greedy by putting a "?" after the "*". Thus, given the string "mississippi", if you run the regexp "(i.*?s)" you should get "is".

According to my experiments, DXL does not respect the "?" in the above context. Does anyone know how to cause DXL regexp to run ungreedy?

code
string s = "mississippi"
Regexp r1 = regexp "(i.*s)"
Regexp r2 = regexp "(i.*?s)"
if (r1 s) print s[match 0] "\n"
if (r2 s) print s[match 0] "\n"
SystemAdmin - Wed May 06 15:15:48 EDT 2009

Re: greedy regexp
Heather_Linsk - Wed May 06 15:42:15 EDT 2009

What version of DOORS are you running?

The code works as desired on 9.1:

ississ
is

Re: greedy regexp
Tony_Goodman - Thu May 07 02:51:56 EDT 2009

Heather_Linsk - Wed May 06 15:42:15 EDT 2009
What version of DOORS are you running?

The code works as desired on 9.1:

ississ
is

Doesn't work on DOORS 9.0, so I assume this feature was added in DOORS 9.1.

Re: greedy regexp
SystemAdmin - Thu May 07 03:06:02 EDT 2009

Tony_Goodman - Thu May 07 02:51:56 EDT 2009
Doesn't work on DOORS 9.0, so I assume this feature was added in DOORS 9.1.

Regular expression handling was one of the items changed when DOORS was "bluewashed" (built according to IBM) for version 9.1. From 9.1 readme:

Regular expression engine

The regular expression engine has changed. Steps have been taken to ensure DXL compatibility but there may be differences in DXL execution between Telelogic DOORS 8.3 and 9.0 and Telelogic DOORS 9.1. If any issues arise, contact Customer Support.

Re: greedy regexp
SystemAdmin - Thu May 07 08:58:26 EDT 2009

DOORS Ver 9.1 release notes has the following statement about Regular Expressions...
>> The regular expression engine has changed. Steps have been taken to ensure DXL compatibility but there may be differences in DXL execution between Telelogic DOORS 8.3 and 9.0 and Telelogic DOORS 9.1. If any issues arise, contact Customer Support.

I assume the term 'Bluewashed' means that the regular expression parser was replaced with one used by other IBM products.
So my questions is what variant of Regular Expressions doe IBM use?

Also...
The new 9.1 command 'regexp2' operation states that it: Creates a regular expression. Its behavior will not be changed to match the legacy behavior of regexp(). Should be used in all new regular expression code.
I am not sure what IBM is communicating in this statement. Does this mean :
Its behavior will not be changed (so as )to match the legacy behavior of regexp()
or
Its behavior will not be changed to match the legacy behavior of regexp() (so that it does not match legacy behavior?)

Between the 8.3 and 9.1 manuals the list of symbols useable in the DXL Reference Manual has not changed - however it is clear that a new parser is now in use. ?????
Does anyone know which implementation of Regular Expressions is now being used? I know a few - Perl, Java, .NET, Python, PHP, many shell tools... Does IBM use one of these defined implementations, or is it yet another?
Each of these are defined implementations are already described in various Regular Expression Reference Manuals. Does anyone (on the inside, maybe ;-) know which parser has been implemented by IBM?